package com.sushe.service;

import com.sushe.dao.StudentDao;
import com.sushe.entity.Student;
import com.sushe.service.jiekou.ShowAllStudentsService;

import java.sql.SQLException;
import java.util.List;

public class ShowAllStudentsServiceImpl implements ShowAllStudentsService {

    private StudentDao studentDao = new StudentDao();


    @Override
    public  void showAllStudents() throws SQLException, ClassNotFoundException {
        System.out.println("展示所有学生信息如下：");
        System.out.println("----------------------------------");
        List<Student> students=studentDao.showAllStudents();
        for(Student student:students){
            System.out.println("学号："+student.getId()+" 姓名："+student.getName()+" 班级："+student.getCalssName());
        }
    }
}
